import request from '@/utils/request'

//  *********企业新增*********
/**   接口名称目录              功能
     
**/
//新增 订单明细
export  const  submitOrder = (form)=>
	request({
		url:'/op/order/create_order',
		method:'post',
		data:JSON.stringify( form )
	})
// 获取与当前用户相关的订单明细列表 
export  const  orderList = (search)=>
	request({
		url:'/op/order/get_order_list',
		method:'get',
		params:search
	})
export  const  detailOrder = (code)=>
	request({
		url:'/op/order/get_order',
		method:'get',
		params:{
			code
		}
	})
	// 删除 订单明细
export  const  delOrdder = (code)=>
	request({
		url:'/op/order/delete_order',
		method:'get',
		params:{
			code
		}
	})
// 新增 货物	
export  const  submitGoods = (form)=>
	request({
		url:'/op/goods/create_goods',
		method:'post',
		data:JSON.stringify( form )
	})
// 修改 货物
export  const  modifyGoods = (form)=>
	request({
		url:'/op/goods/modify_goods',
		method:'post',
		data:JSON.stringify( form )
	})
export  const  getGoodsListOforder = (search)=>
	request({
		url:'/op/goods/get_goods_list',
		method:'get',
		params:{
			orderCode:search.orderCode,
			pageSize:search.pageSize,
			
		} 
	})	
 
// 删除 货物	
export  const  delGood = (code)=>
	request({
		url:'/op/goods/delete_goods',
		method:'get',
		params:{
			code
		}
	})

// 新增 资金流记录
export  const  submitPayment = (form)=>
	request({
		url:'/op/payment_log/create_payment_log',
		method:'post',
		data:JSON.stringify(form)
	})

// 确认资金交易记录	
export  const  confirmRe = (code)=>
	request({
		url:'/op/payment_log/modify_payment_log',
		method:'post',
		data:JSON.stringify({
			code,
			status:'1'
		})
	})

// 新增 合同
export  const  submitContractFile = (url,form)=>
	request({
		url,
		method:'post',
		data:JSON.stringify(form)
	})

// 获取指定的合同	
export  const  getDetailContract = (code)=>
	request({
		url:'/op/contract/get_contract',
		method:'get',
		params:{
			code
		}
	})

	// 根据交易code获取指定的合同
export  const  getContractCode = (code)=>
	request({
		url:'/op/contract/get_contract_by_transaction',
		method:'get',
		params:{
			code
		}
	})	
	// 生成指定合同文件
export  const  produce_Contract = (code,type )=>
	request({
		url:'/op/contract/get_contract_file',
		method:'get',
		params:{
			code,
			type 
		}
	})	


	// 新增 提单
export  const  submitLading = (url,form)=>
	request({
		url,
		method:'post',
		data:JSON.stringify(form)
	})
// 新增 提单状态
export  const  submitLadingStatus = (form)=>
	request({
		url:'/op/lading_bill_status/create_lading_bill_status',
		method:'post',
		data:JSON.stringify(form)
	})
	// 获取指定的交易
export  const  getDetailTransaction = (code)=>
	request({
		url:'/op/transaction/get_transaction',
		method:'get',
		params:{
			code
		}
	})

// 获取资金流记录列表
export  const  getPayList = (search)=>
	request({
		url:'/op/payment_log/get_payment_log_list',
		method:'get',
		params:search
	})

// 新增 退税
export  const  submitRefund = (url,form)=>
	request({
		url,
		method:'post',
		data:JSON.stringify(form)
	})
// 根据订单code获取指定的退税	
export  const  RefundDetailByOrder = (code)=>
	request({
		url:'/op/tax_refund/get_tax_refund_by_order',
		method:'get',
		params:{
			code
		}
	})
// 获取退税信息操作记录列表	 
export  const  RefundLogList = (search)=>
	request({
		url:'/op/tax_refund_log/get_tax_refund_log_list',
		method:'get',
		params:{
			code:search.code,
			pageSize:search.pageSize
		}
	})


// 根据订单code获取指定的提单
export  const  LadingDetailByOrder = (code)=>
	request({
		url:'/op/lading_bill/get_lading_bill_by_order_code',
		method:'get',
		params:{
			code
		}
	})
	// 获取提单信息操作记录列表
export  const  LadingLogList = (search)=>
	request({
		url:'/op/lading_bill_log/get_lading_bill_log_list',
		method:'get',
		params:{
			code:search.code,
			pageSize:search.pageSize
		}
	})
	// 获取提单状态操作记录列表
export  const  LadingStatusList = (search)=>
	request({
		url:'/op/lading_bill_status_log/get_lading_bill_status_log_list',
		method:'get',
		params:{
			code:search.code,
			pageSize:search.pageSize
		}
	})

	// 获取指定的企业授信额度信息
export  const  getEntCredit = (code)=>
	request({
		url:'/op/ent/get_ent_credit',
		method:'get',
		params:{
			code 
		}
	})